package Manager;

import java.awt.*;
import java.sql.*;

import javax.swing.*;

import Database.*;
import Exception.*;

public class MainPanelManager extends JPanel
{
	private JButton buttonStudent, buttonBackup, buttonAccount;
	private JLabel labelSlogan, labelElsaIcon, labelElsa, labelBackground;
	
	public MainPanelManager(CallDB callDB, Connection connection) throws LoadDriverException, CheckDataException
	{	
		setLayout(null);
		
		createComponent();
		showComponent();
	}
	
	public void createComponent() throws CheckDataException
	{
		labelElsaIcon = new JLabel("");
		labelElsaIcon.setIcon(new ImageIcon("image/ElsaIcon.png"));

		labelElsa = new JLabel("ELSA");
		labelElsa.setHorizontalAlignment(SwingConstants.LEFT);
		labelElsa.setFont(new Font("Constantia", Font.ITALIC, 88));
		
		labelSlogan = new JLabel("Assessment Time Management");
		labelSlogan.setFont(new Font("Constantia", Font.ITALIC, 15));
		
		buttonAccount = new JButton("Account");
		buttonAccount.setName("Account");
		
		buttonStudent = new JButton("Student");
		buttonStudent.setName("Student");
		
		buttonBackup = new JButton("Backup");
		buttonBackup.setName("Backup");
		
		labelBackground = new JLabel("");
		labelBackground.setIcon(new ImageIcon("image/Bg-Main.jpg"));
	}
	
	public void showComponent()
	{
		labelElsaIcon.setBounds(30, 40, 117, 135);
		labelElsa.setBounds(130, 70, 221, 91);
		labelSlogan.setBounds(130, 150, 221, 16);
		labelBackground.setBounds(0, 0, 800, 600);
		buttonAccount.setBounds(317, 200, 150, 40);	//347, 170, 90, 30
		buttonStudent.setBounds(317, 260, 150, 40);	//347, 240, 90, 30
		buttonBackup.setBounds(317, 320, 150, 40);	//347, 310, 90, 30
		
		this.add(labelElsaIcon);
		this.add(labelElsa);
		this.add(labelSlogan);
		this.add(buttonAccount);
		this.add(buttonStudent);
		this.add(buttonBackup);
		this.add(labelBackground);
	}
	
	public JButton getButtonAccount(){return buttonAccount;}
	public JButton getButtonStudent(){return buttonStudent;}
	public JButton getButtonBackup(){return buttonBackup;}
}